import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";

const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHashHistory(),
  routes: [
    {
      path: "/LiveClass",
      name: "LiveClass",
      component: () => import("../views/Home/LiveClass.vue"),
    },
    {
      path: "/LiveDetalis",
      name: "LiveDetalis",
      component: () => import("../views/Home/LiveDetalis.vue"),
    },
    {
      path: "/search",
      name: "Search",
      component: () => import("../views/Home/Search.vue"),
    },
    // 注册登录页面
    {
      path: "/login",
      name: "login",
      component: () => import("../views/passwordLogin/index.vue"),
    },
    // 注册页面
    {
      path: "/Register",
      name: "Register",
      component: () => import("../views/passwordLogin/Register.vue"),
    },
    // 设置密码页面
    {
      path: "/setPassword",
      name: "setPassword",
      component: () => import("../views/passwordLogin/setPassword.vue"),
    },
    {
      path: "/setUpInfo",
      name: "setUpInfo",
      component: () => import("../views/MyInfo/setUpInfo.vue"),
    },

    {
      path: "/ReplaceTel/:mobile",
      name: "ReplaceTel",
      component: () => import("../views/SetTel/ReplaceTel.vue"),
    },
    // 我的收藏
    {
      path: "/MyCollection",
      name: "MyCollection",
      component: () => import("../views/MyInfo/MyCollection.vue"),
    },
    // 我的订单
    {
      path: "/Myorgin",
      name: "Myorgin",
      component: () => import("../views/MyInfo/Myorgin.vue"),
    },
    // 点击头像个人
    {
      path: "/Personalnfo",
      name: "Personalnfo",
      component: () => import("../views/Personalnfo/index.vue"),
    },
    {
      path: "/Upname",
      name: "Upname",
      component: () => import("../views/Personalnfo/Upname.vue"),
    },
    // 更换头像
    {
      path: "/UPhead",
      name: "UPhead",
      component: () => import("../views/Personalnfo/UPhead.vue"),
    },


    // tabBar
    {
      path: "/index",
      name: "index",
      component: () => import("../index.vue"),
      children: [
        {
          path: "/",
          name: "home",
          component: () => import("../views/Home/HomeView.vue"),
        },
        {
          path: "/mylesson",
          name: "MyLesson",
          component: () => import("../views/MyLesson/index.vue"),
        },
        {
          path: "/miaowu",
          name: "Miaowu",
          component: () => import("../views/Miaowu/index.vue"),
        },
        {
          path: "/tool",
          name: "Tool",
          component: () => import("../views/Tool/index.vue"),
        },
        {
          path: "/myinfo",
          name: "MyInfo",
          component: () => import("../views/MyInfo/index.vue"),
        },
      ]
    },
  ],
});

export default router;
